import 'package:flutter/material.dart';
import 'package:lovify/widgets/aq_button.dart';
import 'package:lovify/widgets/aq_text.dart';

class DialogUtils {

  static void showInfoDialog(BuildContext context, String message, {String title = '提示', VoidCallback? onOk}) {
    showDialog(
      context: context,
      builder: (context) {
        return AlertDialog(
          backgroundColor: Colors.white,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(4),
          ),
          title: AQText(
            content: title,
            fontSize: 24,
          ),
          content: AQText(
            fontSize: 14,
            content: message,
            color: const Color(0xFF6B7280),
          ),
          actions: [
            AQButton(
              label: "确认",
              onPressed: () {
                DialogUtils.pop(context);
                if (onOk != null) onOk();
              }
            )
          ],
        );
      },
    );
  }

  static void pop(BuildContext context) {
    Navigator.of(context).pop();
  }

}
